home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4258 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  44 lines

  1. Newsgroups: comp.lang.c++
  2. Path: cs.vu.nl!alverste
  3. From: alverste@cs.vu.nl (Andre Versteeg)
  4. Subject: Life is strange, especially with Watcom
  5. Nntp-Posting-Host: sloep52.cs.vu.nl
  6. Sender: news@cs.vu.nl
  7. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  8. Date: Mon, 29 Jan 1996 10:07:50 GMT
  9. X-Newsreader: TIN [version 1.2 PL2]
  10. Message-ID: <DLxtH3.AMA.0.-s@cs.vu.nl>
  11.  
  12.  
  13. I have trouble with the difference between C and C++ with Watcom 10.0:
  14.  
  15. ---
  16.  
  17. I have a library with the following function in the .H header file:
  18.  
  19. int Setup(void)
  20.  
  21. With this library came a .C example file which used this function as follows:
  22.  
  23. int v;
  24. v = Setup();
  25.  
  26. All compiles very well, until I changed the code to:
  27.  
  28. int v = Setup(); and changed the filename to .CPP
  29.  
  30. Now the compiler screams the following:
  31.  
  32. * Undefined reference: int near Setup(void)
  33.  
  34. ----
  35.  
  36. My question is (easy to guess):
  37.  
  38. How can I change my code, so that the compiler generates it correctly ?
  39. I'm compiling with DOS4GW in Protected Mode.
  40.  
  41. Can somebody offer a solution ? I'm not allowed to change the library...
  42.  
  43.  
  44.